﻿using NUnit.Framework;
namespace Models.CoreModels.Tests
{
  [TestFixture, Category("Models")]
  public class CoreModelTests
  {
    #region TestPlumbing
    [TestFixtureSetUp]
    public void FixtureSetup()
    {
      //Setup code runs once prior to any test execution.
    }
    [SetUp]
    public void Setup()
    {
      //Setup code runs prior to each test execution.
    }
    [TestFixtureTearDown]
    public void FixtureTearDown()
    {
      //Cleanup code runs once after all tests have executed.
    }
    [TearDown]
    public void TearDown()
    {
      //Cleanup code runs after each test execution.
    }
    #endregion //TestPlumbing
    #region Tests
    [Test, Category("Unit")]
    public void ModelAConstruction()
    {
      //Is there need for a factory pattern?
      var aSystemXModel = new CoreModelA();
      Assert.IsNotNull(aSystemXModel, "Constructor failed!");
    }
    [Test, Category("Unit")]
    public void ModelBConstruction()
    {
      //Is there need for a factory pattern?
      var bSystemXModel = new CoreModelB();
      Assert.IsNotNull(bSystemXModel, "Constructor failed!");
    }
    [Test, Category("Unit")]
    public void ModelCConstruction()
    {
      //Is there need for a factory pattern?
      var cSystemXModel = new CoreModelC();
      Assert.IsNotNull(cSystemXModel, "Constructor failed!");
    }
    [Test, Category("Unit")]
    public void ValidNames()
    {
      const string aName = "AnyStringValue";
      var aSystemXModel = new CoreModelA();
      Assert.IsNotNull(aSystemXModel, "Constructor failed!");
      Assert.IsNotNull(aSystemXModel.Name, "Name property should not initialize to null value!");
      Assert.IsEmpty(aSystemXModel.Name, "Name property should initialize to empty string!");
      aSystemXModel.Name = aName;
      Assert.AreEqual(aName, aSystemXModel.Name, "Name property did not assign correctly!");
      aSystemXModel.Name = null;
      Assert.IsNotNull(aSystemXModel.Name, "Name property should not allow setting to null value!");
      Assert.IsEmpty(aSystemXModel.Name, "Name property should be set to empty string!");
    }
    #endregion//Tests
  }
}
